//
//  AXFAccountSettingViewController.m
//  AIXF
//
//  Created by Macx on 2017/7/14.
//  Copyright © 2017年 Macx. All rights reserved.
//

#import "AXFAccountSettingViewController.h"
#import "AXFSettingTableViewCell.h"
#import "AXFAboutViewController.h"
@interface AXFAccountSettingViewController ()<UITableViewDataSource,UITableViewDelegate>

@end

@implementation AXFAccountSettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UITableView *tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    [self.view addSubview:tableView];
    [tableView registerNib:[UINib nibWithNibName:@"AXFSettingTableViewCell" bundle:nil] forCellReuseIdentifier:@"cell"];
    tableView.dataSource = self;
    tableView.delegate = self;
    tableView.rowHeight = 50;
    tableView.tableFooterView = [UIView new];
    tableView.backgroundColor = [UIColor whiteColor];
    
}



- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 40;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView *view = [UIView new];
    view.backgroundColor = [UIColor whiteColor];
    return view;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0)
    {
        return 2;
    }
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    AXFSettingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    cell.backgroundColor = [UIColor groupTableViewBackgroundColor];
    
    
    if (indexPath.section == 0)
    {
        if (indexPath.row == 0)
        {
            cell.cellIndex = 0;
        }else
        {
            cell.cellIndex = 1;
        }
    }
    else
    {
        cell.cellIndex = 2;
    }
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0 && indexPath.row == 0)
    {
        AXFAboutViewController *vc = [AXFAboutViewController new];
        
        [self.navigationController pushViewController:vc animated:YES];
    }
}



@end
